package com.jiamingZhao.pojo.entity;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.jiamingZhao.annotations.TableField;
import com.jiamingZhao.annotations.TableName;
import com.jiamingZhao.pojo.entity.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@TableName("blade_tenant")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class Tenant extends BaseEntity {


	/**
	 * 租户ID
	 */
	@TableField("tenant_id")
	@Schema(description = "租户ID")
	private String tenantId;
	/**
	 * 租户名称
	 */
	@Schema(description = "租户名称")
	@NotBlank(message = "机构名称不能为空")
	private String tenantName;
	/**
	 * 域名地址
	 */
	@Schema(description = "域名地址")
	private String domainUrl;
	/**
	 * 系统背景
	 */
	@Schema(description = "系统背景")
	private String backgroundUrl;
	/**
	 * 联系人
	 */
	@Schema(description = "联系人")
	@NotBlank(message = "联系人不能为空")
	private String linkman;
	/**
	 * 联系电话
	 */
	@Schema(description = "联系电话")
	@NotBlank(message = "联系电话不能为空")
	private String contactNumber;
	/**
	 * 联系地址
	 */
	@Schema(description = "联系地址")
	@NotBlank(message = "公司地址不能为空")
	private String address;
	/**
	 * 账号额度
	 */
	@Schema(description = "账号额度")
	private Integer accountNumber;
	/**
	 * 过期时间
	 */
	@DateTimeFormat(pattern = DatePattern.CHINESE_DATE_PATTERN)
	@JsonFormat(pattern = DatePattern.CHINESE_DATE_PATTERN)
	@Schema(description = "过期时间")
	private Date expireTime;
	/**
	 * 产品包ID
	 */
	@JsonSerialize(nullsUsing = NullSerializer.class)
	@Schema(description = "产品包ID")
	private Long packageId;
	/**
	 * 数据源ID
	 */
	@JsonSerialize(nullsUsing = NullSerializer.class)
	@Schema(description = "数据源ID")
	private Long datasourceId;
	/**
	 * 授权码
	 */
	@Schema(description = "授权码")
	private String licenseKey;

}
